import api from '@/api';

export default {
  namespace: 'productService',
  state: {

  },

  effects: {
    *queryProductServices({ payload }, { call, put }) {
      return yield call(api.productService.queryProductServices, payload);
    },
    *createProductService({ payload }, { call, put }) {
      return yield call(api.productService.createProductService, payload);
    },
    *queryImportResult({ payload }, { call, put }) {
      return yield call(api.productService.queryImportResult, payload);
    },
    *saveImportResult({ payload }, { call, put }) {
      return yield call(api.productService.saveImportResult, payload);
    },
    *removeProductService({ payload }, { call, put }) {
      return yield call(api.productService.removeProductService, payload);
    },
    *queryServices({ payload }, { call, put }) {
      return yield call(api.service.query, payload);
    },

  },

  reducers: {
    saveSysRoots(state, { payload }) {
      return {
        ...state,
        sysRoots: payload,
      };
    }

  },
};
